<template>
  <div>
    <Header :title="title"></Header>
    <p>我买的玩具：{{ parentBuiedToy }}</p>
    <p>我从Child那里拿到的玩具: {{ fromChildToy }}</p>

    <PropsChildCompound :myParentsGivenToy="parentBuiedToy" :sendToy="getToyFromChild"></PropsChildCompound>
  </div>
</template>
<script lang="ts" setup>
import PropsChildCompound from "@/components/passvalue/PropsChildCompound.vue"
import { ref } from "vue"
import Header from "@/components/Header.vue"
const title = "Props传递值"
const parentBuiedToy = "小坦克"

const fromChildToy = ref<string>('')
function getToyFromChild(toy: string) {
  fromChildToy.value = toy
  console.log(toy)
}

</script>
<style lang="scss" scoped></style>
